﻿//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using System.Threading.Tasks;
//using System.Windows.Media.Imaging;
//using Microsoft.Kinect;

//namespace VideoMagic
//{
//    public static class Functions3D
//    {
//        public static byte[] MixAlpha(byte[] backgroundPixel, byte[] foregroundPixel, byte foregroundAlpha)
//        {
//            for (int i = 0; i < foregroundPixel.Length; i++)
//            {
//                foregroundPixel[i] = MixAlpha(backgroundPixel[i], foregroundPixel[i], foregroundAlpha);
//            }

//            return foregroundPixel;
//        }

//        public static byte MixAlpha(byte backgroundPixel, byte foregroundPixel, byte foregroundAlpha)
//        {
//            double backgroundPixelDouble = backgroundPixel;
//            double foregroundPixelDouble = foregroundPixel;
//            double foregroundAlphaDouble = foregroundAlpha;

//            byte retval = Convert.ToByte(foregroundPixelDouble * foregroundAlphaDouble / 255 + backgroundPixelDouble * (255 - foregroundAlphaDouble) / 255);
//            return retval;
//        }
//    }
//}
